<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>后台详情修改页面</title>
    <style>
        body {
            font-family: Arial, sans-serif;
            margin: 0;
            padding: 20px;
        }
        .container {
            max-width: 800px;
            margin: 0 auto;
            padding: 20px;
            border: 1px solid #ccc;
            border-radius: 8px;
            box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
        }
        h1 {
            text-align: center;
        }
        .form-group {
            margin-bottom: 15px;
        }
        .form-group label {
            display: block;
            margin-bottom: 5px;
        }
        .form-group input, .form-group textarea, .form-group img {
            width: 100%;
            padding: 8px;
            box-sizing: border-box;
        }
        .form-group img {
            max-width: 100%;
            height: auto;
            cursor: pointer; /* 允许点击图片以选择新图片（实际功能需后端支持） */
        }
        .keywords input {
            width: auto;
            margin-right: 5px;
            margin-bottom: 5px;
        }
    </style>
</head>
<body>
    <div class="container">
        <h1>后台详情修改</h1>
        <form action="/submit-details" method="post" enctype="multipart/form-data"> <!-- 假设提交到/submit-details处理 -->
            <div class="form-group">
                <label for="cover-image">封面图片:</label>
                <img id="cover-image-preview" src="path/to/current/cover.jpg" alt="封面图片" onclick="document.getElementById('cover-image-input').click();"> <!-- 预览当前封面图片，点击以选择新图片 -->
                <input type="file" id="cover-image-input" name="cover-image" style="display: none;" accept="image/*">
            </div>
            <div class="form-group">
                <label for="title">标题:</label>
                <input type="text" id="title" name="title" value="当前标题">
            </div>
            <div class="form-group">
                <label for="name">名称:</label>
                <input type="text" id="name" name="name" value="当前名称">
            </div>
            <div class="form-group">
                <label for="content">文章内容:</label>
                <textarea id="content" name="content" rows="10">当前文章内容</textarea>
            </div>
            <div class="form-group keywords">
                <label for="keywords">关键词:</label>
                <input type="text" name="keywords[]" value="关键词1">
                <input type="text" name="keywords[]" value="关键词2">
                <!-- 可以添加更多关键词输入框，或使用JavaScript动态添加 -->
            </div>
            <button type="submit">保存修改</button>
        </form>
    </div>

    <!-- 假设有一个简单的JavaScript用于处理封面图片的预览 -->
    <script>
        document.getElementById('cover-image-input').addEventListener('change', function(event) {
            const file = event.target.files[0];
            const reader = new FileReader();
            reader.onload = function(e) {
                document.getElementById('cover-image-preview').src = e.target.result;
            };
            reader.readAsDataURL(file);
        });
    </script>
</body>
</html>